<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta name="author" content="">
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
   
<?php 
//{asset name='Head'}
$this->RenderAsset('Head'); 
$Session = Gdn::Session();
?>
<body id="<?php echo $BodyIdentifier; ?>" class="<?php echo $this->CssClass; ?>" data-spy="scroll" data-target=".subnav" data-offset="50">

  
<div class="container" id="wrapper">

<!-- --> 
<pre>
<?php 
    // print_r($this->Menu);

    // print_r(Gdn::Config());
 ?>
 </pre>      
<!-- -->
</div>



   <header>
    <div class="navbar navbar-fixed-top" >
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"></a>
          <a class="brand" href="<?php echo Url('/'); ?>"><?php echo Gdn_Theme::Logo(); ?></a>
          <div class="nav-collapse collapse">  

<?php
         

             
             if ($this->Menu) {
          //    $this->Menu->ClearGroups();
                
                $this->Menu->CssClass="nav";
                $this->Menu->HtmlId="header-nav";
                echo $this->Menu->ToString();

                $this->Menu->ClearGroups();  
                $this->Menu->CssClass="nav pull-right";
                $this->Menu->HtmlId="header-navright"; 


                if ($Session->IsValid()) {

                $this->Menu->AddLink('Dashboard', T('Dashboard'), '/dashboard/settings', array('Garden.Settings.Manage'));
                $this->Menu->AddLink('Activity', T('Activity'), '/activity');

                $Name = $Session->User->Name;
                $CountNotifications = $Session->User->CountNotifications;
               


                if (is_numeric($CountNotifications) && $CountNotifications > 0)
                      $Name .= ' <span class="Alert">'.$CountNotifications.'</span>';

                       if (urlencode($Session->User->Name) == $Session->User->Name)
                          $ProfileSlug = $Session->User->Name;
                       else
                          $ProfileSlug = $Session->UserID.'/'.urlencode($Session->User->Name);


                    $this->Menu->AddLink('User', $Name, '/profile/'.$ProfileSlug, array('Garden.SignIn.Allow'), array('class' => 'UserNotifications'));
                    $this->Menu->AddLink('SignOut', "退出", SignOutUrl(), FALSE, array('class' => 'NonTab SignOut'));
                  } else {
                    $Attribs = array();
                    if (SignInPopup() && strpos(Gdn::Request()->Url(), 'entry') === FALSE)
                      $Attribs['class'] = 'SignInPopup';
                      
                    $this->Menu->AddLink('Entry',"登录", SignInUrl($this->SelfUrl), FALSE, array('class' => 'NonTab'), $Attribs);
                }

                echo $this->Menu->ToString();

          }
?>
          
<?php
         
         
            
            
         
?>         
          </div>
        </div>
      </div>
    </div>

    </header>
    <footer class="footer" id="bootstrap-footer">
    <div class="container">
      <p class="pull-right"><a href="#top" class="back-to-top">返回上面</a></p>
      <?php $this->RenderAsset('Head'); ?>

    </div>
  </footer>
</body>
</html>